package com.jzoom.zoom.admin.interceptors;

import com.jzoom.zoom.common.annotations.Inject;
import com.jzoom.zoom.dao.Dao;
import com.jzoom.zoom.web.action.ActionContext;
import com.jzoom.zoom.web.action.ActionInterceptorAdapter;

import java.util.Map;

public class ServerInterceptor extends ActionInterceptorAdapter {

    @Inject("admin")
    private Dao dao;

    @Override
    public void parse(ActionContext context) throws Exception {
       Map<String,Object> data = (Map<String, Object>) context.getPreParam();

        String appid = (String) data.get("appid");
        //appid的key
        dao.record("sys_dic").where("type","appid")
                .where("name",appid).filter("value").get();


//        //签名错误
//        if(!SignUtil.validate(data,key)){
//            LogUtil.log("%s %s",request.getServletPath(),data.toString());
//            throw new SignError();
//        }
//
//        context.put("appId",mchId);
//        context.put("_mchId",mchId);
//
//        request.setAttribute("_mchId", mchId);
//        request.setAttribute("_mchKey", key);

    }
}
